
class Campo():

    def __init__(self):
        self.nome    = ""
        self.tipo    = ""
        self.tabela  = ""
        self.valores = []

    def __getattr__(self, name):

        if name == "nome":
            return self.nome

        elif name == "tipo":
            return self.tipo

        elif name == "tabela":
            return self.tabela

        elif name == "valores":
            return self.valores

        else:
            raise AttributeError, name


    def __setattr__(self, name, value):

        if name == "nome":
           self.__dict__["nome"]     = value

        elif name == "tipo":
            self.__dict__["tipo"]    = value

        elif name == "tabela":
            self.__dict__["tabela"]  = value

        elif name == "valores":
            self.__dict__["valores"] = value

        else:
            raise AttributeError, name
